package cn.edu.ctbu.labtest.dao;

import cn.edu.ctbu.labtest.domain.Course;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * 课程仓库接口
 */
public interface CourseRepository extends JpaRepository<Course,Integer> {
    Page<Course> findByNameLike(String name, Pageable pageable);

    @Query("select o from tb_course o where o.name = :name")
    List<Course> findByName(@Param("name") String name);
}
